﻿
#include "Test/Debug.h"


ADebug::ADebug()
{
	PrimaryActorTick.bCanEverTick = true;
}

void ADebug::BeginPlay()
{
	Super::BeginPlay();
	
}

void ADebug::Tick(float DeltaTime)
{
	Super::Tick(DeltaTime);
}

void ADebug::DebugSphere(const FVector& Location, float Duration)
{
	// Segments: 球体的分段数。
	// bPersistentLines: true 表示一直显示；为 false 时 LifeTime生效，表示持续多少秒。
	// Thickness: 表示线框的粗细。
	DrawDebugSphere(GetWorld(), Location, 12.0f, 24, FColor::Blue, false, Duration, 0, 2.0f);
}

void ADebug::DebugLine(const FVector& StartLocation, const FVector& EndLocation)
{
	DrawDebugLine(GetWorld(),  StartLocation, EndLocation, FColor::Green, true);
}

void ADebug::DebugBox(const FVector& Location, const FVector& Size)
{
	DrawDebugBox(GetWorld(), Location, Size, FColor::Green, true);
}

void ADebug::DebugPoint(const FVector& Location, float Size)
{
	DrawDebugPoint(GetWorld(), Location, Size, FColor::Emerald, true);
}

